package com.wenwei.parking;

import android.app.Application;
import android.content.Context;
import android.os.Handler;
import android.support.multidex.MultiDex;

import com.orhanobut.logger.Logger;
import com.tencent.bugly.crashreport.CrashReport;
import com.umeng.message.IUmengRegisterCallback;
import com.umeng.message.PushAgent;

import cn.sharesdk.framework.ShareSDK;


/**
 * Created by Administrator on 2017/5/15.
 */
public class BaseApplication extends Application {


    private static Context mContext;
    private static BaseApplication sInstance;

    public static BaseApplication getInstance() {
        return sInstance;
    }


    @Override
    public void onCreate() {
        super.onCreate();
        sInstance = this;
        BaseApplication.mContext = getApplicationContext();
//        CrashReport.initCrashReport(getApplicationContext(), "49683d3462", true);
        ShareSDK.initSDK(this);
        MultiDex.install(this) ;
        PushAgent mPushAgent = PushAgent.getInstance(this);
        //注册推送服务，每次调用register方法都会回调该接口
        mPushAgent.register(new IUmengRegisterCallback() {

            @Override
            public void onSuccess(String deviceToken) {
                //注册成功会返回device token
                Logger.d("Success:"+deviceToken);
            }

            @Override
            public void onFailure(String s, String s1) {
                Logger.d(s + "," + s1);
            }
        });
    }



    public static Context getAppContext(){
        return mContext;
    }
}
